import request from "../utils/request";


// TODO:从后台获取学生数据
// export const getStudentList = () => request<any, any>({
//   url: '/student/list',
//   method: 'get',
// })

// export const updateStudent = (stu:IStudent)=>request.post('/student/update', stu)

// 模拟获取学生数据
export const getStudentList = (currentPage:number, pageSize:number) => {
    const students: ITeacher[] = [
        {
            id: "1",
            teacherNo: 2001,
            name: "李老师",
            photo: "https://example.com/photo1.jpg",
            age: 35,
            phone: "13800000001",
            email: "li.teacher@example.com",
            address: "北京市朝阳区",
            major: "计算机科学",
            college: "计算机学院",
            salary: 12000,
            remark: "教学经验丰富"
        },
        {
            id: "2",
            teacherNo: 2002,
            name: "张老师",
            photo: "https://example.com/photo2.jpg",
            age: 40,
            phone: "13800000002",
            email: "zhang.teacher@example.com",
            address: "上海市徐汇区",
            major: "软件工程",
            college: "计算机学院",
            salary: 15000,
            remark: "热爱教学"
        },
        {
            id: "3",
            teacherNo: 2003,
            name: "王老师",
            photo: "https://example.com/photo3.jpg",
            age: 38,
            phone: "13800000003",
            email: "wang.teacher@example.com",
            address: "广州市天河区",
            major: "人工智能",
            college: "计算机学院",
            salary: 14000,
            remark: "研究方向为深度学习"
        },
        {
            id: "4",
            teacherNo: 2004,
            name: "赵老师",
            photo: "https://example.com/photo4.jpg",
            age: 45,
            phone: "13800000004",
            email: "zhao.teacher@example.com",
            address: "深圳市南山区",
            major: "信息安全",
            college: "计算机学院",
            salary: 16000,
            remark: "专业知识扎实"
        },
        {
            id: "5",
            teacherNo: 2005,
            name: "孙老师",
            photo: "https://example.com/photo5.jpg",
            age: 30,
            phone: "13800000005",
            email: "sun.teacher@example.com",
            address: "成都市锦江区",
            major: "数据科学",
            college: "计算机学院",
            salary: 13000,
            remark: "积极参与科研"
        },
        {
            id: "6",
            teacherNo: 2006,
            name: "周老师",
            photo: "https://example.com/photo6.jpg",
            age: 33,
            phone: "13800000006",
            email: "zhou.teacher@example.com",
            address: "武汉市洪山区",
            major: "网络工程",
            college: "计算机学院",
            salary: 12500,
            remark: "擅长项目管理"
        },
        {
            id: "7",
            teacherNo: 2007,
            name: "吴老师",
            photo: "https://example.com/photo7.jpg",
            age: 37,
            phone: "13800000007",
            email: "wu.teacher@example.com",
            address: "南京市秦淮区",
            major: "软件测试",
            college: "计算机学院",
            salary: 13500,
            remark: "注重教学质量"
        },
        {
            id: "8",
            teacherNo: 2008,
            name: "郑老师",
            photo: "https://example.com/photo8.jpg",
            age: 29,
            phone: "13800000008",
            email: "zheng.teacher@example.com",
            address: "长沙市芙蓉区",
            major: "云计算",
            college: "计算机学院",
            salary: 11500,
            remark: "年轻有为"
        },
        {
            id: "9",
            teacherNo: 2009,
            name: "冯老师",
            photo: "https://example.com/photo9.jpg",
            age: 42,
            phone: "13800000009",
            email: "feng.teacher@example.com",
            address: "天津市和平区",
            major: "人工智能",
            college: "计算机学院",
            salary: 15500,
            remark: "科研成果显著"
        },
        {
            id: "10",
            teacherNo: 2010,
            name: "陈老师",
            photo: "https://example.com/photo10.jpg",
            age: 36,
            phone: "13800000010",
            email: "chen.teacher@example.com",
            address: "青岛市市南区",
            major: "信息技术",
            college: "计算机学院",
            salary: 14500,
            remark: "热心指导学生"
        }
    ];
    console.log("模拟获取学生数据",currentPage,pageSize)
    return {
        code: 200,
        data: {students, total: 18},
        message: 'success'
    }
}
// 模拟按学号或姓名查询学生数据
export const searchStudent = (keyword:string, currentPage:number, pageSize:number) => {
    console.log("模拟按学号或姓名查询学生数据",keyword, currentPage, pageSize)
    return {
        code: 200,
        data: {students: [
            {
                id: "1",
                teacherNo: 2001,
                name: "李老师",
                photo: "https://example.com/photo1.jpg",
                age: 35,
                phone: "13800000001",
                email: "li.teacher@example.com",
                address: "北京市朝阳区",
                major: "计算机科学",
                college: "计算机学院",
                salary: 12000,
                remark: "教学经验丰富"
            },
        ], total: 1},
        message: 'success'
    }
}

// 模拟修改学生数据
export const updateStudent = (stu:IStudent)=>{
    console.log("模拟修改学生数据",stu)
    return {
        code: 200,
        data: null,
        message: 'success'
    }
}

// 模拟添加学生数据
export const addStudent = (stu:IStudent)=>{
    console.log("模拟添加学生数据",stu)
    return {
        code: 200,
        data: null,
        message: 'success'
    }
}
// 模拟删除学生数据
export const deleteStudent = (id:string)=>{
    console.log("模拟删除学生数据",id)
    return {
        code: 200,
        data: null,
        message: 'success'
    }
}